package com.rnkrsoft.suyan.config.server.config.entity;

import com.rnkrsoft.framework.orm.PrimaryKey;
import com.rnkrsoft.framework.orm.PrimaryKeyStrategy;
import com.rnkrsoft.framework.orm.jdbc.*;
import com.rnkrsoft.suyan.config.internal.enums.AuthorityStatusEnum;
import lombok.*;

/**
 * Created by woate on 2019/5/23.
 */
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "AUTHORITY_INFO", prefix = "TB")
@Comment("权限息表")
public class AuthorityInfoEntity extends BaseEntity{
    @PrimaryKey(strategy = PrimaryKeyStrategy.UUID)
    @StringColumn(name = "AUTHORITY_ID", nullable = false)
    @Comment("权限编号")
    String authorityId;

    @NumberColumn(name = "RESOURCE_TYPE", nullable = false)
    @Comment("资源类型")
    Integer resourceType;

    @StringColumn(name = "RESOURCE_ID", nullable = false)
    @Comment("资源编号")
    String resourceId;

    @NumberColumn(name = "USER_ID", nullable = false)
    @Comment("用户编号")
    Integer userId;

    @StringColumn(name = "USER_NAME", nullable = false)
    @Comment("用户姓名")
    String userName;

    @NumberColumn(name = "CREATE_OPERATOR_ID", nullable = false)
    @Comment("进行授权操作的操作员编号")
    Integer createOperatorId;

    @StringColumn(name = "CREATE_OPERATOR_NAME", nullable = false)
    @Comment("进行授权操作的操作员姓名")
    String createOperatorName;

    @StringColumn(name = "DELETE_OPERATOR_ID", nullable = true)
    @Comment("进行删除操作的操作员编号")
    String deleteOperatorId;

    @StringColumn(name = "DELETE_OPERATOR_NAME", nullable = true)
    @Comment("进行删除操作的操作员姓名")
    String deleteOperatorName;

    @NumberColumn(name = "AUTHORITY_STATUS", nullable = false, enumClass = AuthorityStatusEnum.class, defaultValue = "1")
    @Comment("权限状态")
    Integer authorityStatus;
}
